/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:49 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class HoidapEntity
    {
        public HoidapEntity()
        {
			m_pk_ihoidapid=0;
			m_fk_ibaihocid=0;
			m_fk_igiangvienid=0;
			m_fk_ihocvienid=0;
			m_snoidung="";
			m_dngayhoidap=DateTime.Now;
        }
		private Int64 m_pk_ihoidapid;
		public Int64 PK_iHoidapID
		{
			get { return m_pk_ihoidapid ; }
			set { m_pk_ihoidapid = value; }
		}
		private Int64 m_fk_ibaihocid;
		public Int64 FK_iBaihocID
		{
			get { return m_fk_ibaihocid ; }
			set { m_fk_ibaihocid = value; }
		}
		private Int64 m_fk_igiangvienid;
		public Int64 FK_iGiangvienID
		{
			get { return m_fk_igiangvienid ; }
			set { m_fk_igiangvienid = value; }
		}
		private Int64 m_fk_ihocvienid;
		public Int64 FK_iHocvienID
		{
			get { return m_fk_ihocvienid ; }
			set { m_fk_ihocvienid = value; }
		}
		private String m_snoidung;
		public String sNoidung
		{
			get { return m_snoidung ; }
			set { m_snoidung = value; }
		}
		private DateTime m_dngayhoidap;
		public DateTime dNgayhoidap
		{
			get { return m_dngayhoidap ; }
			set { m_dngayhoidap = value; }
		}

        #region Comparison
        public static List<HoidapEntity> Sort(List<HoidapEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(HoidapEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<HoidapEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<HoidapEntity> COMPARISON_PK_iHoidapID
		{
			get
			{
				return delegate(HoidapEntity entity,HoidapEntity other)
				{
					return entity.PK_iHoidapID.CompareTo(other.PK_iHoidapID);
				};
			}
		}
		public static Comparison<HoidapEntity> COMPARISON_FK_iBaihocID
		{
			get
			{
				return delegate(HoidapEntity entity,HoidapEntity other)
				{
					return entity.FK_iBaihocID.CompareTo(other.FK_iBaihocID);
				};
			}
		}
		public static Comparison<HoidapEntity> COMPARISON_FK_iGiangvienID
		{
			get
			{
				return delegate(HoidapEntity entity,HoidapEntity other)
				{
					return entity.FK_iGiangvienID.CompareTo(other.FK_iGiangvienID);
				};
			}
		}
		public static Comparison<HoidapEntity> COMPARISON_FK_iHocvienID
		{
			get
			{
				return delegate(HoidapEntity entity,HoidapEntity other)
				{
					return entity.FK_iHocvienID.CompareTo(other.FK_iHocvienID);
				};
			}
		}
		public static Comparison<HoidapEntity> COMPARISON_sNoidung
		{
			get
			{
				return delegate(HoidapEntity entity,HoidapEntity other)
				{
					return entity.sNoidung.CompareTo(other.sNoidung);
				};
			}
		}
		public static Comparison<HoidapEntity> COMPARISON_dNgayhoidap
		{
			get
			{
				return delegate(HoidapEntity entity,HoidapEntity other)
				{
					return entity.dNgayhoidap.CompareTo(other.dNgayhoidap);
				};
			}
		}
        #endregion
    }
}
